<?php
/**
 * 
 * ClientEngage: ClientEngage Visitor Voice (http://www.clientengage.com)
 * Copyright 2012, ClientEngage (http://www.clientengage.com)
 *
 * You must have purchased a valid license from CodeCanyon in order to have 
 * the permission to use this file.
 * 
 * You may only use this file according to the respective licensing terms 
 * you agreed to when purchasing this item on CodeCanyon.
 * 
 * 
 * 
 *
 * @author          ClientEngage <contact@clientengage.com>
 * @copyright       Copyright 2013, ClientEngage (http://www.clientengage.com)
 * @link            http://www.clientengage.com ClientEngage
 * @since           ClientEngage - Visitor Voice v 1.0
 * 
 */
?>
<div class="visitorforms row">
    <div class="visitorforms span12">
        <?php echo $this->Form->create('Visitorform', array('class' => 'form-horizontal')); ?>
        <fieldset>
            <legend><?php echo __('Edit Visitorform'); ?></legend>
            <div class="row-fluid">
                <div class="span4">
                    <?php
                    echo $this->Form->input('id');
                    if ($this->Form->value('Visitorform.active') === true)
                        echo $this->Html->link('<i class="ico-cancel"></i> ' . __('Active - Deactivate Now'), array('action' => 'activate', $this->Form->value('Visitorform.id'), 'type' => 'deactivate'), array('class' => 'btn btn-mini btn-success', 'escape' => false));
                    else
                        echo $this->Html->link('<i class="ico-tick"></i> ' . __('Inactive - Activate Now'), array('action' => 'activate', $this->Form->value('Visitorform.id'), 'type' => 'activate'), array('class' => 'btn btn-mini btn-danger', 'escape' => false)) . ' ' . $this->Layout->renderHelpIcon(__('Activating this form will make it available on websites where the inclusion code is used.'));
                    echo '<hr />';
                    echo $this->Form->input('archived', array('label' => __('Archived'))) . '<hr/>';
                    echo $this->Form->input('title', array('label' => __('Title'), 'class' => 'span12'));
                    echo $this->Form->input('slug', array('label' => __('Url') . ' ' . $this->Layout->renderHelpIcon(__('The unique ID of your form.')), 'class' => 'span12'));
                    echo $this->Form->input('title_tag', array('label' => __('Title Tag of Form Button'), 'class' => 'span12'));
                    echo $this->Form->input('formtheme_id', array('label' => __('Form Theme'), 'class' => 'span12'));
                    echo $this->Form->input('buttontheme_id', array('label' => __('Button Theme'), 'class' => 'span12'));
                    echo $this->Form->input('modal_width', array('label' => __('Modal Width'), 'class' => 'span12'));
                    echo $this->Form->input('modal_height', array('label' => __('Modal Height'), 'class' => 'span12'));
                    echo $this->Form->input('class_suffix_container', array('label' => __('Container Class Suffix'), 'class' => 'span12'));
                    echo $this->Form->input('redirect_url', array('label' => __('Redirect URL') . ' ' . $this->Layout->renderHelpIcon(__('The redirect will be processed after the success page has loaded.')), 'class' => 'span12'));
                    ?>
                </div>
                <div class="span8">
                    <?php
                    echo $this->Form->tinyMce('description', array('label' => __('Description')));
                    echo $this->Form->tinyMce('text_success', array('label' => __('Success Page Text')));
                    echo $this->Form->input('error_message', array('label' => __('Validation Error Message'), 'class' => 'span12'));
                    ?>
                </div>
            </div>

            <div class="form-actions">
                <?php echo $this->Form->submit(__('Submit'), array('class' => 'btn btn-primary blockinterface', 'div' => false)); ?>
                <?php echo $this->Html->link(__('Cancel'), array('action' => 'view', $this->Form->value('Visitorform.id')), array('class' => 'btn btn-cancel')); ?>
                <?php echo $this->Form->postLink(__('Delete'), array('action' => 'delete', $this->Form->value('Visitorform.id')), array('class' => 'btn btn-danger'), __('Are you sure you want to delete "%s"?', $this->Form->value('Visitorform.title'))); ?>
            </div>
        </fieldset>
        <?php echo $this->Form->end(); ?>
    </div>
</div>